Skip to content

Conversation

rantanevich
Copy link

Hello!

I'm trying to install PostgreSQL on a fresh Ubuntu 22.04 with postgresql_data_directory: /data/postgresql, but I'm getting the following error:

TASK [anxs.postgresql : PostgreSQL | Verify postgresql cluster version] ********
fatal: [postgresql-17]: FAILED! => {"changed": false, "cmd": ["grep", "^17$", "/data/postgresql/PG_VERSION"], "delta": "0:00:00.001677", "end": "2025-06-03 15:31:21.968610", "msg": "non-zero return code", "rc": 2, "start": "2025-06-03 15:31:21.966933", "stderr": "grep: /data/postgresql/PG_VERSION: No such file or directory", "stderr_lines": ["grep: /data/postgresql/PG_VERSION: No such file or directory"], "stdout": "", "stdout_lines": []}

The only workaround I've found is to set postgresql_cluster_reset: true, but that's not very convenient.

Instead, I suggest reinitializing the cluster not only when postgresql_cluster_reset: true, but also when postgresql_data_directory is empty (contains no files or directories).

Copy link

github-actions bot commented Sep 1, 2025

This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

@github-actions github-actions bot added the stale label Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant